package com.xb.loan.util.ocr;


import com.xb.loan.util.file.FileLoader;

import java.util.Properties;

public class FilePro {
    private static FilePro instance=null;
    //上传文件临时目录，文件上传解析后目录
    private String fileTempDir;

    //文件上传文件保存目录,身份证保存路径###
    private String userDir;
    //行驶证文件保存路径
    private String productDir;
    //百度云官网获取的 API Key##
    private String apiKey="lK6SLRUSLq4b17PjSYNAjXnR";
    //百度云官网获取的 Securet Key
    private String secretKey="pC1zqKsm8nNjnuDjmd80Piem6IsLTiWm";
    //百度云官网获取 APP Key ###
    private String appId="10035933";

    private static Properties pro;

    private FilePro(){

        pro = FileLoader.loadProByClassPath("./config/file.properties");
        if(pro == null){
            System.out.println("Properties文件解析错误");
        }
    }
    public static FilePro getInstance(){
        if(instance==null){
            synchronized(FilePro.class){
                if(instance==null){
                    instance=new FilePro();
                }
            }
        }
        return instance;
    }

    public String getFileTempDir() {
        return (String)pro.get("file_temp_dir");
    }

    public String getUserDir() {
        return (String)pro.get("file_dir_user");
    }

    public String getProductDir() {
        return (String)pro.get("file_dir_product");
    }

    public String getApiKey() {
        return (String)pro.get("API_KEY");
    }

    public String getSecretKey() {
        return (String)pro.get("SECRET_KEY");
    }

    public String getAppId() {
        return (String)pro.get("APP_ID");
    }

    public String getValueByKey(String key){return (String)pro.get(key);}

    public static void main(String []args){
        FilePro.getInstance();
    }

}
